import 'package:flutter/material.dart';
import 'package:local_coffee/components/hex.dart';
import 'package:local_coffee/components/rgba.dart';
import 'package:local_coffee/utils/global.dart';
import 'package:local_coffee/components/icon.dart';

AppBar customAppBar({
  BuildContext context,
  String title = '',
  bool borderBottom = true,
  List actions
}) {
  return AppBar(
    centerTitle: true,
    title: Text(
      title,
      style: TextStyle(
        color: RGBA.rgba383838,
        fontSize: 18,
        fontWeight: FontWeight.bold
      ),
    ),
    backgroundColor: HEX.hexfff,
    elevation: 0,
    leading: context == null 
      ? null 
      : InkWell(
        child: icon0xe611(color: RGBA.rgba2c2c2c, size: 16),
        onTap: () => Navigator.pop(context),
      ),
    bottom: PreferredSize(
      child: Container(
        decoration: BoxDecoration(
          border: G.borderBottom(
            show: borderBottom
          )
        ),
      ),
      preferredSize: Size.fromHeight(0),
    ),
    actions: actions,
  );
}